#ifndef CODER_H_
#define CODER_H_

#include "rawdata.h"
#include "compresseddata.h"
#include <string>

class Coder
{
private:
	enum Mode
	{
		D_CONT, D_END, D_FIN
	};
	bool debug;
public:
	Coder(bool debug) :
			debug(debug)
	{
	}
	void encode(RawDataInput& input, CompressedDataOutput& output, int M);
	void decode(CompressedDataInput& input, RawDataOutput& output, int M);
	int adapt(std::vector<RawDataInput::Comparator> dictBuilder);

private:
	std::string* debugCodes(int bit, Mode mode = D_CONT);
	std::string* debugSymbols(int symbol, Mode mode = D_CONT);
};

#endif /* CODER_H_ */
